﻿using System;
using System.Collections.Generic;
using System.Linq;
using Model.User;
using Model.Course;

namespace Controller
{
    public static class TaskController
    {


        public static void viewTask(int taskId)        
        {
            
        }

        public static Task createTask(int courseId, string name, DateTime start, DateTime end, string content, Attachment[] att)
        {
            Task l = Task.create(Course.get(courseId), name, start, end, content);

            if (att != null)
            {
                foreach (var a in att)
                {
                    l.addAttachment(a);
                }
            }

            return l;
        }

        public static SolvedTask createSolvedTask(int taskId, int studentId, String content)
        {
            Task task = Task.get(taskId);
            Student student = Student.get(studentId);

            if (task == null || student == null) return null;

            SolvedTask st = SolvedTask.create(student, task, content);
            return st;
        }

        public static void deleteTask(object taskId)        
        {
            
        }
        public static void editTask(object taskId)        
        {
            
        }
        public static void solveTask(object taskId, object content, object attachments)        
        {
            
        }
        public static void markSolvedTask(int mark, object solvedTaskId)        
        {
            
        }
    }
}